From 668924b42074efd53e03450643fd97605f061278 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 2 Feb 2004 17:02:36 +0000 Subject: [PATCH] Add 1252 conversions for hint and shortname. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@686 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/cetus.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gpsbabel/cetus.c b/gpsbabel/cetus.c index 60a8e74cf..feb1abbfe 100644 --- a/gpsbabel/cetus.c +++ b/gpsbabel/cetus.c @@ -263,8 +263,10 @@ cetus_writewpt(const waypoint *wpt) vdata = (char *)rec + sizeof(*rec); if ( wpt->shortname ) { - strncpy( vdata, wpt->shortname, 16 ); - vdata[15] = '\0'; + char *sn = str_utf8_to_cp1252(wpt->shortname); + strncpy( vdata, sn, 16 ); + vdata[15] = '\0'; + xfree(sn); } else { vdata[0] ='\0'; @@ -308,8 +310,10 @@ cetus_writewpt(const waypoint *wpt) vdata += strlen( vdata ) + 1; if (wpt->gc_data.hint) { + char *hint = str_utf8_to_cp1252(wpt->gc_data.hint); rec->type = WptCache; - strncpy( vdata, wpt->gc_data.hint, NOTESZ + 1 ) ; + strncpy( vdata, hint, NOTESZ + 1 ) ; + xfree(hint); vdata[NOTESZ] = '\0'; } else { rec->type = WptEdit; -- 2.30.2